from django.shortcuts import render

# Create your views here.

from home.models import Banner
from rest_framework.viewsets import GenericViewSet
from rest_framework.mixins import ListModelMixin
from home.serializer.serializers import BannerSerializer

# 导入django内置的配置名称空间
from django.conf import *

class BannerViewSet(GenericViewSet,ListModelMixin):
    queryset = Banner.objects.filter(is_delete=False,is_show=True).order_by('-orders')[:settings.BANER_COUNT]

    serializer_class = BannerSerializer






